import request from "@/apps/admin/units/request"
import {HttpResultData} from "@/types/project";

/**
 * 登录刷新
 * @returns {*}
 */
export const loginRefreshApi = (): Promise<HttpResultData<any>> => request(`/common/login-refresh`, {}, 'GET', {tips: false})


/**
 * 获取配置系统配置
 */
export const getConfigureApi = (): Promise<HttpResultData<any>> => request(`configure`, {}, 'GET', {tips: false})



/**
 * 获取系统信息
 */
export const getSystemInfoApi = (): Promise<HttpResultData<any>> => request(`system-info`)


/**
 * 获取日志大小
 */
export const getLoggerSizeApi = (): Promise<HttpResultData<any>> => request(`logger-size`)


/**
 * 获取服务列表
 */
export const getSerlistApi = (): Promise<HttpResultData<any>> => request(`/common/serlist`)

/**
 * 修改密码
 * @param data.old_password
 * @param data.password
 * @param data.password2
 * @returns {*}
 */
export const editUserPasswdApi = (data: any): Promise<HttpResultData<any>> => request(`/common/edit-passwd`, data, 'POST')


/**
 * 修改用户信息
 * @param data.old_password
 * @param data.password
 * @param data.password2
 * @returns {*}
 */
export const editUserDataApi = (data: any): Promise<HttpResultData<any>> => request(`/common/edit-data`, data, 'POST')


/**
 * 获取权限节点数据
 */
export const getPermissionsFormDataApi = (): Promise<HttpResultData<any>> => request(`/common/permissions-form-data`)
